package com.hrc.actuator.health;

import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.stereotype.Component;

@Component
public class MyHealthIndicator implements HealthIndicator {
    @Override
    public Health health() {
        // 自定义检查方法
        // Health.up().build()代表健康情况下返回
        return Health.down().withDetail("msg", "内部发生错误").build();
    }
}
